home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / tex-k / tex-k-archive.past / tex-k-archive.gz / tex-k-archive / 000071_Martyn.Johnson@cl.cam.ac.uk_Thu Oct 21 16:32:19 1993.msg < prev    next >
Internet Message Format  |  1994-10-11  |  3KB

  1. Received: from swan.cl.cam.ac.uk by cs.umb.edu with SMTP id AA23162
  2.   (5.65c/IDA-1.4.4 for <tex-k@cs.umb.edu>); Thu, 21 Oct 1993 17:36:15 -0400
  3. Received: from ashby.cl.cam.ac.uk (user maj (rfc931)) by swan.cl.cam.ac.uk 
  4.           with SMTP (PP-6.5) to cl; Thu, 21 Oct 1993 15:32:45 +0100
  5. To: tex-k@cs.umb.edu
  6. Cc: Martyn.Johnson@cl.cam.ac.uk
  7. Subject: Problem with EPSF handling in xdvik 1.3
  8. Date: Thu, 21 Oct 93 15:32:19 +0100
  9. From: Martyn Johnson <Martyn.Johnson@cl.cam.ac.uk>
  10. Message-Id: <"swan.cl.cam.:041040:931021143257"@cl.cam.ac.uk>
  11.  
  12. When I first tried out the EPSF handling in xdvik I found that it
  13. worked fine, but later on I discovered that it was only working
  14. intermittently. Sometimes the PostScript conversion would fail with
  15. a message like:
  16.  
  17.  xdvi: espf: sh command "(echo 0 0 translate 0.990099 0.990099 scale;
  18.  cat /homes/maj/epsf/pic.ps; echo showpage) | gs -q -sDEVICE=bit -r100
  19.  -g140x140 -sOutputFile=/tmp/aaa001215 - 1>/dev/null 2>&1"
  20.  failed with status -1.
  21.  
  22. A bit of detective work revealed that the call of "system" was
  23. returning with errno=EINTR, caused by a SIGIO signal.
  24.  
  25. The simplest fix seemed to be to remove the signal handler before
  26. calling "system", and reinstate it (and call it just in case)
  27. afterwards.  Here are the patches I applied.  A more elegant solution
  28. may be possible.
  29.  
  30. *** 1.1    1993/10/19 14:24:55
  31. --- xdvik/xdvi.c    1993/10/19 14:36:45
  32. ***************
  33. *** 2012,2018 ****
  34.   }
  35.   
  36.   #ifdef    HAS_SIGIO
  37. ! static    void
  38.   handle_intr() {
  39.       event_counter = 1;
  40.       event_freq = -1;    /* forget Plan B */
  41. --- 2012,2018 ----
  42.   }
  43.   
  44.   #ifdef    HAS_SIGIO
  45. ! extern    void
  46.   handle_intr() {
  47.       event_counter = 1;
  48.       event_freq = -1;    /* forget Plan B */
  49. *** 1.1    1993/10/19 14:03:29
  50. --- xdvik/epsf.c    1993/10/19 14:32:27
  51. ***************
  52. *** 31,36 ****
  53. --- 31,37 ----
  54.   
  55.   #include "epsf.h"
  56.   extern void put_grey_rectangle ();
  57. + extern void handle_intr ();
  58.   
  59.   #ifndef L_tmpnam
  60.   #define L_tmpnam 256
  61. ***************
  62. *** 262,268 ****
  63. --- 263,276 ----
  64.         -llx, -lly, x_scale, y_scale, name, GSEXEC, RESOLUTION,
  65.         (int)result->w, (int)result->h, tempfilename);
  66.   
  67. + #ifdef HAS_SIGIO
  68. +   (void) signal(SIGIO, SIG_IGN);
  69. + #endif
  70.     status = system(command);
  71. + #ifdef HAS_SIGIO
  72. +   (void) signal(SIGIO, handle_intr);
  73. +   handle_intr();
  74. + #endif
  75.     if (status) {             /* Something went wrong. */
  76.       char buff[256];
  77.       sprintf(buff, "sh command \"%s\" failed with status %d.",
  78.  
  79.  
  80.  
  81.  
  82. Martyn Johnson      maj@cl.cam.ac.uk
  83. University of Cambridge Computer Lab
  84. Cambridge UK
  85.